package com.design.pattern.memo;

import java.util.Date;

public class Client {
    public static void main(String[] args) {
        System.out.println("游戏开始");
        //棋盘
        CheckerBoard checkerBoard=new CheckerBoard();
        //下棋
        checkerBoard.down(new Piece(PieceColor.black,17,16,5000l));
        checkerBoard.down(new Piece(PieceColor.white,19,12,10000l));
        checkerBoard.down(new Piece(PieceColor.black,17,19,5000l));
        checkerBoard.show();
        //创建备份
        Caretaker caretaker=new Caretaker();
        //输出内容
        caretaker.savePieceMemo(checkerBoard.createMemo());
        //下棋
        checkerBoard.down(new Piece(PieceColor.white,12,16,5000l));
        checkerBoard.show();
        //恢复到备份
        checkerBoard.resetCheckerBoardMemo(caretaker.getLast());
        checkerBoard.show();

    }

}
